import mockjs from 'mockjs';

export default {
  'GET /blockchain/All/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'hash': '1',
      'prevHash': '@word(20)',
      'nextHash': '@word(20)',
    }
  }),
  'GET /blockchain/All/2': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'hash': '1',
      'dataSize': '@word(20)',
      'data': '@word(20)',
    }
  }),
  'GET /blockchain/All/3': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'hash': '2',
      'propertyTypeName': '@word(20)',
      'amount': '@word(20)',
    }
  }),
  'GET /blockchain/blocklist/9/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 100,
    'page': 1,
    'data|9': [{
      'blockHash': '@word(60)',
      'height|+1': 405492,
      'miner': '@word(5)',
      'outputTime': 1000,
      'transactionNumber': 1000
    }]
  }),
  'GET /blockchain/blocklist/9/2': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 100,
    'page': 2,
    'data|9': [{
      'blockHash': '@word(60)',
      'height|+1': 1,
      'miner': '@word(5)',
      'outputTime': 1000,
      'transactionNumber': 1000
    }]
  }),
  'GET /blockchain/transactionlist/9/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 100,
    'page': 1,
    'data|9': [{
      'fromAddress': '@word(20)',
      'height|+1': 405492,
      'outputTime': 1000,
      "propertyType" : '资产交易 ',
      'toAddress': '@word(20)',
      'transactionHash': '@word(20)',
    }]
  }),
  'GET /blockchain/transactionlist/9/2': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 100,
    'page': 2,
    'data|9': [{
      'fromAddress': '@word(20)',
      'height|+1': 1,
      'outputTime': 1000,
      "propertyType" : '资产交易 ',
      'toAddress': '@word(20)',
      'transactionHash': '@word(20)',
    }]
  }),
  'GET /blockchain/block/transactionList/1/3/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 30,
    'page': 1,
    'data|3': [{
      'amount|+1': [0.43252, null, null],
      'hash': '@word(50)',
      'dataSize|+1': [0, 256, null],
      'fromAddress': '@word(25)',
      'toAddress': '@word(25)',
      'outputTime': '@now',
      'name|+1': ['0GB', null, null],
      'type|+1': ['转账', '存证', '竞选'],
    }]
  }),
  'GET /blockchain/block/transactionList/1/3/2': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 30,
    'page': 2,
    'data|3': [{
      'amount|+1': [0.43252, null, null],
      'hash': '@word(50)',
      'dataSize|+1': [0, 256, null],
      'fromAddress': '@word(25)',
      'toAddress': '@word(25)',
      'outputTime': '@now',
      'name|+1': ['0GB', null, null],
      'type|+1': ['转账', '存证', '竞选'],
    }]
  }),
  'GET /blockchain/block/transactionList/1/10/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 30,
    'page': 1,
    'data|10': [{
      'amount|+1': [0.43252, null, null],
      'hash': '@word(50)',
      'dataSize|+1': [0, 256, null],
      'fromAddress': '@word(25)',
      'toAddress': '@word(25)',
      'outputTime': '@now',
      'name|+1': ['0GB', null, null],
      'type|+1': ['转账', '存证', '竞选'],
    }]
  }),
  'GET /blockchain/block/transactionList/1/10/2': mockjs.mock({
    'code': 200,
    'msg': '',
    'total': 30,
    'page': 2,
    'data|10': [{
      'amount|+1': [0.43252, null, null],
      'hash': '@word(50)',
      'dataSize|+1': [0, 256, null],
      'fromAddress': '@word(25)',
      'toAddress': '@word(25)',
      'outputTime': '@now',
      'name|+1': ['0GB', null, null],
      'type|+1': ['转账', '存证', '竞选'],
    }]
  }),
  'GET /blockchain/block/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'blockHash': '@word(20)',
      'committee': '45届',
      'height': 405492,
      'id': 1000,
      'miner': '@word(5)',
      'nextHash': '@word(20)',
      'nonce|+1': 4352,
      'outputTime': '@now',
      'parentList|2-3': ['@word(40)'],
      'prevHash': '@word(20)',
      'stateRoot': '@word(40)',
      'transactionAvgCon': 1.325,
      'transactionNumber': 10292,
      'unionSign': '@word(100)',
      'unionSignPublic': '@word(100)',
    }
  }),
  'GET /blockchain/transaction/1': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'hash': '@word(20)',
      'type': '存证',
      'height|+1': 405492,
      'outputTime': '@now',
      'propertyTypeName': null,
      'amount|+1': null,
      'dataSize|+1': 500,
      'name': '@word(5)',
      'accountNonce|+1': 4352,
      'sign': '@word(100)',
      'fromAddress': '@word(20)',
      'toAddress': '@word(20)',
      'parentList|2-3': ['@word(40)'],
      'data': '{"code":200,"msg":"","data":{"hash":"meekwuqufyijphwyvwmu","type":"存证","height":405492,"outputTime":"2020-06-18 21:45:22","propertyTypeName":"0GB","amount":45.21,"dataSize":null,"name":"jugxe","accountNonce":4352,"sign":"dvdoouwsqvbuvgrlsobnyurqrotvzwlwuqkiqpciwuxcxectxmotgprxmmxpfsccvxyfgmhxnejmvgtmpxdgdbklhevdtenvlcdv","fromAddress":"oztvbehnzbrvxuxwwyni","toAddress":"ioasclcignkqrdkbbsoy"}}',
    }
  }),
  'GET /blockchain/transaction/2': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'hash': '@word(20)',
      'type': '存证',
      'height|+1': 405492,
      'outputTime': '@now',
      'propertyTypeName': '0GB',
      'amount|+1': 45.21,
      'dataSize|+1': null,
      'name': '@word(5)',
      'accountNonce|+1': 4352,
      'sign': '@word(100)',
      'fromAddress': '@word(20)',
      'toAddress': '@word(20)',
      'parentList|2-3': ['@word(40)'],
      'data': null,
    }
  }),
  'GET /node/networkInfo': mockjs.mock({
    'code': 200,
    'msg': '',
    'data': {
      'latestBlock': 456753,
      'netTPS': 5000,
      'submitTPS': 8594,
      'preOutputTime': '3.526s',
      'avgOutputTime': '2.326s',
      'consensusNodes': '20/20',
      'ledgerSize': '14.64GB',
      'netAccounts': 66666,
      'assetTypeCount': 567,
    }
  }),
  'GET /node/nodeInfo': mockjs.mock({
    'code': 200,
    'msg': '',
    'data|7': [{
      'nodeName': '@word(10)',
      'version': 'OGFull-v1.0.1',
      'delay': '100ms',
      'connectionCount|+1': 10,
      'latestBlockHeight': '#456,753',
      'latestBlockHash': '@word(20)',
      'latestBlockTime': 0,
      'broadcastTime': '+39ms',
      'avgBroadcastTime': '+68ms',
      'committee': 'Yes',
      'transactionInProcess': 567,
    }],
  })
}

